package demo04;

import java.security.PrivateKey;

/**
 * @author JYH
 * @version 1.0
 * @date 2022/10/31 15:14
 */
public class Boy implements Runnable{
    private Card card;

    public Boy(Card card) {
        this.card = card;
    }

    @Override
    public void run() {
        for (int i = 0; i < 10; i++) {
            card.setBalance(card.getBalance()+1000);
            System.out.println(Thread.currentThread().getName()+"存入一千元,卡中余额："+card.getBalance());
        }
    }
}
